﻿<Window x:Class="DLogQueryWpfApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="516" Width="864"  Loaded="Window_Loaded">
    <Window.Resources>
        <DataTemplate x:Key="dtLogLevel">
            <TextBlock x:Name="txtLogLevel" Text="{Binding LogLevel}"></TextBlock>
        </DataTemplate>
    </Window.Resources>
    
    <Grid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="25">
            <TextBlock Text="KeyWord"/>
            <ComboBox Name="cbLogLevel" Width="80"/>
            <Button Name="btnSearch" Content="Search" Click="btnSearch_Click"></Button>
            <DatePicker Name="dpCreateStartDate"/>
            <DatePicker Name="dpCreateEndDate"/>
        </StackPanel>
        <DataGrid x:Name="dgLog" CanUserAddRows="False" ItemsSource="{Binding}" AutoGenerateColumns="False" Margin="0,25,0,25">
            <DataGrid.Columns>
                <DataGridTextColumn Header="LogId" Binding="{Binding LogId}" />
                <DataGridTextColumn Header="CreateDate" Binding="{Binding CreateDate}" />
                <DataGridTextColumn Header="Origin" Binding="{Binding Origin}" />
                <!--<DataGridTextColumn Header="LogLevel" Binding="{ Binding, Source={ StaticResource, ResourceKey=dtLogLevel}}" />-->
                <DataGridTextColumn Header="LogLevel" Binding="{Binding LogLevel}"/>
                <DataGridTextColumn Header="Message" Binding="{Binding Message}" />
                <DataGridTextColumn Header="StackTrade" Binding="{Binding StackTrade}" />
            </DataGrid.Columns>
        </DataGrid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom"  Height="25">
            <TextBlock Text="转到" />
            <TextBox Name="tbxPageNum" />
            <TextBlock Text="页" />
            <Button Name="btnGo" Content="GO" Click="btnGo_Click"/>
            <Button Name="btnUp" Content="上一页" Click="btnUp_Click"/>
            <Button Name="btnNext" Content="下一页" Click="btnNext_Click"/>
            <TextBlock Height="20">  
                <TextBlock Text="【共" />  
                <TextBlock Name="tbkTotalPage" Foreground="Red" />  
                <TextBlock Text="页】" />  
                <TextBlock Text="【当前" />  
                <TextBlock Name="tbkCurrentIndex" Foreground="Red" />  
                <TextBlock Text="页】" />  
            </TextBlock>
        </StackPanel>
    </Grid>
</Window>
